package testClasses;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import utilities.Key;

import com.jme3.asset.AssetKey;
import com.jme3.asset.AssetManager;
import com.jme3.input.InputManager;
import com.jme3.scene.Node;
import controller.AbstractController;
import controller.IController;
import controls.IMasterControl;
import eventManager.EventManager;
import gameAppLayer.ExternalData;
import gameAppLayer.MyMainApp;
import gameAppLayer.StrategyCamera;
import gameAppLayer.XMLData;

public abstract class ATest {
	
	protected EventManager eventManager;
	protected AssetManager assetManager;
	protected InputManager inputManager;
	protected Node node;
	protected MyMainApp app;
	protected ExternalData externalData;
	protected StrategyCamera stratCam;
	public String name;
	public HashMap<Key, IMasterControl> controlMap = new HashMap<Key, IMasterControl>();
	
	
	public ATest(TestingSystem system) {
		this.eventManager = system.eventManager;
		this.inputManager = system.inputManager;
		this.node = system.node;
		this.app = system.app;
		this.externalData = system.externalData;
		this.stratCam = system.stratCam;
		eventManager.addControlMapReference(controlMap);
		
		//setController();				
	}
	
	private void setController() {
		//controllerMap = new HashMap<Key, Controller>();
		//events.setControllerMapReference(controllerMap);
	}
	
	public void update(float tpf) {
		for (Map.Entry<Key, IMasterControl> entry : controlMap.entrySet()) {
			entry.getValue().update(tpf);
		}
		
	}

	public abstract boolean execute() throws FileNotFoundException, IOException, ClassNotFoundException;

}
